package ar.com.gals.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@SequenceGenerator(
	name = "gals_id_sequence", 
	sequenceName = "observacion_id_seq", 
	allocationSize = 1
)
@Table(name="observacion")
public class Observacion extends Gals {

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "articulo_id", referencedColumnName = "id", nullable = false)
	private Articulo articulo;
	
	@OneToOne
	@JoinColumn(name = "tipo_observacion_id", referencedColumnName = "id", nullable = false)
	private TipoObservacion tipoObservacion;
	
	@Column(name="valor", nullable = false)
	private String valor;

	
	public Articulo getArticulo() {
		return articulo;
	}
	public void setArticulo(Articulo articulo) {
		this.articulo = articulo;
	}
	public TipoObservacion getTipoObservacion() {
		return tipoObservacion;
	}
	public void setTipoObservacion(TipoObservacion tipoObservacion) {
		this.tipoObservacion = tipoObservacion;
	}
	public String getValor() {
		return valor;
	}
	public void setValor(String valor) {
		this.valor = valor;
	}
}
